package com.douziit.meilianoa.base.utils.config;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import java.util.List;

/**
 * Excel配置文件 对应*.setting.xml文件
 * 
 * @author yeshujun
 */
@XmlRootElement
public class ExcelSettings {
	/**
	 * 数据库所有表配置List集合
	 */

	private List<TableSetting> tableSetting;

	@XmlElement
	public List<TableSetting> getTableSetting() {
		return tableSetting;
	}

	public void setTableSetting(List<TableSetting> tableSetting) {
		this.tableSetting = tableSetting;
	}

	@XmlRootElement
	public static class TableSetting {
		private String name;
		private String title;
		private String templatePath;
		private List<ColumnSetting> columnSetting;

		@XmlAttribute
		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		@XmlAttribute
		public String getTitle() {
			return title;
		}

		public void setTitle(String title) {
			this.title = title;
		}

		@XmlElement
		public List<ColumnSetting> getColumnSetting() {
			return columnSetting;
		}

		public void setColumnSetting(List<ColumnSetting> columnSetting) {
			this.columnSetting = columnSetting;
		}

		@XmlAttribute
		public String getTemplatePath() {
			return templatePath;
		}

		public void setTemplatePath(String templatePath) {
			this.templatePath = templatePath;
		}
	}

	@XmlRootElement
	public static class ColumnSetting {
		private String name;
		private String title;
		private int width = 10 * 256;
		private String align;
		private String formatter;

		@XmlAttribute
		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		@XmlAttribute
		public String getTitle() {
			return title;
		}

		public void setTitle(String title) {
			this.title = title;
		}

		@XmlAttribute
		public String getFormatter() {
			return formatter;
		}

		public void setFormatter(String formatter) {
			this.formatter = formatter;
		}

		@XmlAttribute
		public int getWidth() {
			return width;
		}

		public void setWidth(int width) {
			this.width = width;
		}

		@XmlAttribute
		public String getAlign() {
			return align;
		}

		public void setAlign(String align) {
			this.align = align;
		}
	}
}
